/*
 * XML Type:  XGrid
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XGrid
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XGrid(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XGridImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XGrid
{
    private static final long serialVersionUID = 1L;
    
    public XGridImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName HEADER$0 = 
        new javax.xml.namespace.QName("", "header");
    private static final javax.xml.namespace.QName BODY$2 = 
        new javax.xml.namespace.QName("", "body");
    private static final javax.xml.namespace.QName NEWROWABLE$4 = 
        new javax.xml.namespace.QName("", "newRowable");
    private static final javax.xml.namespace.QName DESIGNABLE$6 = 
        new javax.xml.namespace.QName("", "designable");
    
    
    /**
     * Gets the "header" element
     */
    public com.seedwill.xul.core.XGridHeader getHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridHeader target = null;
            target = (com.seedwill.xul.core.XGridHeader)get_store().find_element_user(HEADER$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "header" element
     */
    public boolean isSetHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(HEADER$0) != 0;
        }
    }
    
    /**
     * Sets the "header" element
     */
    public void setHeader(com.seedwill.xul.core.XGridHeader header)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridHeader target = null;
            target = (com.seedwill.xul.core.XGridHeader)get_store().find_element_user(HEADER$0, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XGridHeader)get_store().add_element_user(HEADER$0);
            }
            target.set(header);
        }
    }
    
    /**
     * Appends and returns a new empty "header" element
     */
    public com.seedwill.xul.core.XGridHeader addNewHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridHeader target = null;
            target = (com.seedwill.xul.core.XGridHeader)get_store().add_element_user(HEADER$0);
            return target;
        }
    }
    
    /**
     * Unsets the "header" element
     */
    public void unsetHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(HEADER$0, 0);
        }
    }
    
    /**
     * Gets the "body" element
     */
    public com.seedwill.xul.core.XGridBody getBody()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridBody target = null;
            target = (com.seedwill.xul.core.XGridBody)get_store().find_element_user(BODY$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "body" element
     */
    public boolean isSetBody()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BODY$2) != 0;
        }
    }
    
    /**
     * Sets the "body" element
     */
    public void setBody(com.seedwill.xul.core.XGridBody body)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridBody target = null;
            target = (com.seedwill.xul.core.XGridBody)get_store().find_element_user(BODY$2, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XGridBody)get_store().add_element_user(BODY$2);
            }
            target.set(body);
        }
    }
    
    /**
     * Appends and returns a new empty "body" element
     */
    public com.seedwill.xul.core.XGridBody addNewBody()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XGridBody target = null;
            target = (com.seedwill.xul.core.XGridBody)get_store().add_element_user(BODY$2);
            return target;
        }
    }
    
    /**
     * Unsets the "body" element
     */
    public void unsetBody()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BODY$2, 0);
        }
    }
    
    /**
     * Gets the "newRowable" attribute
     */
    public boolean getNewRowable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NEWROWABLE$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(NEWROWABLE$4);
            }
            if (target == null)
            {
                return false;
            }
            return target.getBooleanValue();
        }
    }
    
    /**
     * Gets (as xml) the "newRowable" attribute
     */
    public org.apache.xmlbeans.XmlBoolean xgetNewRowable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(NEWROWABLE$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_default_attribute_value(NEWROWABLE$4);
            }
            return target;
        }
    }
    
    /**
     * True if has "newRowable" attribute
     */
    public boolean isSetNewRowable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(NEWROWABLE$4) != null;
        }
    }
    
    /**
     * Sets the "newRowable" attribute
     */
    public void setNewRowable(boolean newRowable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NEWROWABLE$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NEWROWABLE$4);
            }
            target.setBooleanValue(newRowable);
        }
    }
    
    /**
     * Sets (as xml) the "newRowable" attribute
     */
    public void xsetNewRowable(org.apache.xmlbeans.XmlBoolean newRowable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(NEWROWABLE$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_store().add_attribute_user(NEWROWABLE$4);
            }
            target.set(newRowable);
        }
    }
    
    /**
     * Unsets the "newRowable" attribute
     */
    public void unsetNewRowable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(NEWROWABLE$4);
        }
    }
    
    /**
     * Gets the "designable" attribute
     */
    public boolean getDesignable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESIGNABLE$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(DESIGNABLE$6);
            }
            if (target == null)
            {
                return false;
            }
            return target.getBooleanValue();
        }
    }
    
    /**
     * Gets (as xml) the "designable" attribute
     */
    public org.apache.xmlbeans.XmlBoolean xgetDesignable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(DESIGNABLE$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_default_attribute_value(DESIGNABLE$6);
            }
            return target;
        }
    }
    
    /**
     * True if has "designable" attribute
     */
    public boolean isSetDesignable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(DESIGNABLE$6) != null;
        }
    }
    
    /**
     * Sets the "designable" attribute
     */
    public void setDesignable(boolean designable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESIGNABLE$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(DESIGNABLE$6);
            }
            target.setBooleanValue(designable);
        }
    }
    
    /**
     * Sets (as xml) the "designable" attribute
     */
    public void xsetDesignable(org.apache.xmlbeans.XmlBoolean designable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(DESIGNABLE$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_store().add_attribute_user(DESIGNABLE$6);
            }
            target.set(designable);
        }
    }
    
    /**
     * Unsets the "designable" attribute
     */
    public void unsetDesignable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(DESIGNABLE$6);
        }
    }
}
